<?php
/*
 *  Module Creater
 *
 */
require_once('Index.php');
echo "Please Input The Module Name:";
$module = trim(fgets(STDIN));
echo "Please Input Your Email:";
$email = trim(fgets(STDIN));
$dir = CTPATH;

$fact = "<?php\n";
$fact .= " /*  Filename:{$module}.php\n";
$fact .= "  *  Describe:\n";
$fact .= "  *  {$email}\n";
$fact .= "  *  ".date('Y')." ".date('m')." ".date('d')."\n";
$fact .= "  */\n";

$fact .= "class {$module} extends Controller\n";
$fact .= "{\n";
$fact .= "	function {$module}()\n";
$fact .= "	{\n";
$fact .= "		parent::Controller();\n";
$fact .= "		\$this->_init();\n";
$fact .= "	}\n";
$fact .= "\n";
$fact .= "	function index()\n";
$fact .= "	{\n";
$fact .= "	}\n";
$fact .= "}\n";

$fact .= "?>";
$handle = fopen($dir."/".$module.".php","w+");
fwrite($handle,$fact);
fclose($handle);
exit();
?>